package com.biz.primus.app.erpbridge.interceptor;

import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author yanweijin
 * @date 2017/11/3
 */
@Component
public class AuthInterceptor extends BaseRequestInterceptor {

	public static final String APIKEY_HEADER_NAME = "X-Apikey";

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

		String header = request.getHeader(APIKEY_HEADER_NAME);

		return returnFalseAndResponseJSONResult(response, 900, "鉴权失败");
	}
}
